package yang.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ChufangItmes entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "chufang_itmes", catalog = "hospital")
public class ChufangItmes implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -5729433983664809640L;
	private String id;//UUID
	private ChufangInfo chufangInfo;//关联的处方单表
	private HospitalDrug hospitalDrug;//关联的药品
	private Integer drugShuliang;//数量
	private String drugYongfa;//用法

	// Constructors

	/** default constructor */
	public ChufangItmes() {
	}

	/** minimal constructor */
	public ChufangItmes(String id) {
		this.id = id;
	}

	/** full constructor */
	public ChufangItmes(String id, ChufangInfo chufangInfo,
			HospitalDrug hospitalDrug, Integer drugShuliang, String drugYongfa) {
		this.id = id;
		this.chufangInfo = chufangInfo;
		this.hospitalDrug = hospitalDrug;
		this.drugShuliang = drugShuliang;
		this.drugYongfa = drugYongfa;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "chufang_id")
	public ChufangInfo getChufangInfo() {
		return this.chufangInfo;
	}

	public void setChufangInfo(ChufangInfo chufangInfo) {
		this.chufangInfo = chufangInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "drug_id")
	public HospitalDrug getHospitalDrug() {
		return this.hospitalDrug;
	}

	public void setHospitalDrug(HospitalDrug hospitalDrug) {
		this.hospitalDrug = hospitalDrug;
	}

	@Column(name = "drug_shuliang")
	public Integer getDrugShuliang() {
		return this.drugShuliang;
	}

	public void setDrugShuliang(Integer drugShuliang) {
		this.drugShuliang = drugShuliang;
	}

	@Column(name = "drug_yongfa", length = 30)
	public String getDrugYongfa() {
		return this.drugYongfa;
	}

	public void setDrugYongfa(String drugYongfa) {
		this.drugYongfa = drugYongfa;
	}

}